<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<meta name="csrf-token" content="{{ csrf_token() }}">
    <title>注册</title>
    <link rel="stylesheet" type="text/css" href="css/base.css"/>
    <link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/login.css"/>
    <script src="js/flexible.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/gVerify.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/jquery-3.1.1.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color: #000;"></a>
			<h1 class="mui-title">注册账号</h1>
	</header>
	<div class="content">
		@include('error')
		<form class="mui-input-group" action="register" method="post">
			{{ csrf_field() }}
			<div class="mui-input-row">
				<label>手机号：</label>
				<input type="text" placeholder="请输入手机号" name="phone" value="" id="phone">
			</div>
			<div class="mui-input-row">
				<label>密码：</label>
				<input id="password" type="password" name="password" placeholder="请输入密码" value="">
			</div>
			<div class="mui-input-row">
				<label>确认密码：</label>
				<input type="password" name="password_confirmation" placeholder="请输入密码" value="">
			</div>
			<div class="mui-input-row">
				<label>验证码：</label>
				<input name="yzm"  type="text" placeholder="请输入验证码" value="">
				<button id="v_container" type="button" style="border-left: 1px solid #141414;">获取验证码</button>
			</div>
			<div class="mui-input-row">
				<label>推荐人邀请码：</label>
				<input type="text" name="code" placeholder="(选填)" value="">
			</div>
		<div class="mui-content">
			<div class="mui-content-padded">
				<button type="submit" class="mui-btn mui-btn-primary mui-btn-block" id="btn" style="font-size: 0.4rem;">注册</button>
			</div>
		</div>
	</form>
	</div>
		<script type="text/javascript">
            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
            });
			$('#v_container').click(function(){
			    var phone=$('#phone').val();
			    if(phone==''){
			        alert('请输入手机号');
			        return false;
				}else{
			        $.post('my_send',{phone:phone},function(e){
						if(e.substring(7,8)==0){
						    alert('发送成功');
						}else{
						    alert('发送失败');
						};
					})
				}
			})
		</script>
</body>
</html>